# -*- coding:utf8 -*-
__author__ = 'Forcs'

from wanbatvcom.http.whttp import send_error_response_with_message, send_ok_response_with_data
import wancake.cakeaction.actionhandler as ac_handler

def report_action(request, type=None):
    if not type:
        pass

    handler = ac_handler.ACTION_HANDLER[type]()
    is_ok = handler.handle_action(request)
    if is_ok:
        return send_ok_response_with_data({"actionSession": u'test_session'})
    else:
        return send_error_response_with_message(message=u'have something wrong')
